<template>
  <el-dialog
      title="提示"
      :visible.sync="dialogVisible"
      width="30%"
      :before-close="handleClose">
      <el-form :inline="true" :model="formInline" class="demo-form-inline">
        <el-form-item label="审批人">
          <el-input v-model="formInline.user" placeholder="审批人"></el-input>
        </el-form-item>
        <el-form-item label="活动区域">
          <el-select v-model="formInline.region" placeholder="活动区域">
            <el-option label="区域一" value="shanghai"></el-option>
            <el-option label="区域二" value="beijing"></el-option>
          </el-select>
        </el-form-item>
        <el-form-item>
          <el-button type="primary" @click="onSubmit">查询</el-button>
        </el-form-item>
      </el-form>
  </el-dialog>
</template>
  <script>
    export default {
      data() {
        return {
          dialogVisible:false,
          formInline: {
            user: '',
            region: ''
          },
          resolve: () => {
          },
          reject: () => {
          },
        }
      },
      methods: {
        init(resolve,reject){
          if (!resolve || !reject) return
          this.resolve = resolve ;
          this.reject = reject ;
          this.dialogVisible = true
        },
        onSubmit() {
          console.log('submit!');
          this.resolve("我是子组件的数据")
        },
        handleClose(){
          this.dialogVisible = false
        }
      }
    }
  </script>